1. Technical Field of the Invention
The present invention relates to a random number generating apparatus, a random number generating method, and a recording medium in which a program for generating random numbers is stored, and more specifically to a random number generating apparatus, a random number generating method, a program for generating random numbers, an audio decoder and an audio decoding method, wherein a random number sequence having a desired energy can be generated with a small-scale apparatus.
2. Description of the Related Art
N random numbers Q(1) to Q(N), whose total energy (square sum) is identical with T, that is, square sum Q(1)×Q(1)+Q(2)×Q(2)+ . . . +Q(N)×Q(N)=T, are required.
Such random numbers are used, for instance, in an audio decoder. In accordance with MPEG-4 AAC (Advanced Audio Coding), which is the international standard of audio signal encoding, the random numbers have a function called PNS (Perceptual Noise Substitute). When the PNS is used, detailed information having a predetermined frequency band is not encoded in an audio encoder, but only the total energy E of the frequency domain signals in the frequency band is encoded. In an audio decoder, white noise (random number) whose energy is identical with the total energy E of the coded signals is used as a frequency domain signal in the frequency band. In the case of generating such a signal, it is required to generate a random number sequence having such a specific energy as in the present invention.
In the present invention, pre-specified random numbers are stored in advance, and then used to generate a random number, as will be later described. Such a prior art, in which the random numbers are stored in advance to generate a random number, is disclosed in, for instance, Japanese Unexamined Patent Publication No. 61-114326, Japanese Patent Publication No. 2615743 and Japanese Patent Publication No. 2567681.
Referring to a block diagram shown in FIG. 1, a general method for generating N random numbers Q(1) to Q(N), whose total energy (square sum) is identical with T, will be described. A generalized random number generating apparatus shown in FIG. 1 comprises a random number generating section 701, an energy calculating section 702 and a random number normalizing section 703. The generalized random number generating apparatus having such a circuit arrangement serves to operate as follows:
The number N of random numbers to be output and an energy value T of the random numbers to be output are input in the random number generating apparatus. The random number generating section 701 generates N normal random numbers Q1(1) to Q1(N) and supplies these normal random numbers to both the energy calculating section 702 and the random number normalizing section 703.
The energy calculating section 702 calculates the total energy P of the random numbers Q1(1) to Q1(N), that is, the square sum Q1(1)×Q1(1)+Q1(2)×Q1(2)+ . . . +Q1(N)×Q1(N)=P, and then supplies the total energy P to the random number normalizing section 703.
In the random number normalizing section 703, a normalization coefficient S is firstly determined by raising (T÷P) to the 0.5 power (i.e., a square root of (T÷P)), and subsequently N random numbers Q(1) to Q(N) are determined in such a manner that the total energy T can be obtained from the Q1(1) to Q(N) multiplied by the normalization coefficient S. Namely, each of the random numbers Q(1) to Q(N) is obtained from the calculation of Q(J)=Q1(J)×S as for J=1 to N. The random numbers Q(1) to Q(N) thus obtained are supplied as final outputs from the random number generating apparatus.
In the above-mentioned prior art, a complexity in the process of the energy calculation and the normalization of the random numbers cause the random number generating apparatus to be increased in the scale. In other words, both a large-scale circuit arrangement and the complicated process increase both the space required for the apparatus and the cost. This is due to the facts that the numeric calculations of division and the square root multiplication are required to obtain the normalization coefficient S.